package com.yimingkeji.profile;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Describe:
 * @Auther: zhenlong.yang
 * @Date: 2018/11/23 16:36
 */
@SpringBootApplication
@RestController
public class ProfileApp {

    @Value("${myconf.user.name}")
    private String userName;
    @Value("${myconf.user.address}")
    private String address;

    public static void main(String[] args) {
        SpringApplication.run(ProfileApp.class, args);
    }

    @GetMapping("/name")
    public String getUserName(){
        return userName;
    }


    @GetMapping("/address")
    public String getAddress(){
        return address;
    }

    @GetMapping("/user")
    public String user(){
        return "姓名：" + userName + ", 地址：" + address;
    }
}
